package com.zz.ecommerce.searchManage.taxbill;

import com.zz.ecommerce.common.GridRequest;
import com.zz.ecommerce.common.GridResult;
import com.zz.ecommerce.common.constants.TableConstants;
import com.zz.ecommerce.declareManage.importB2CDeclareDirect.taxbill.CbecTaxDao;
import com.zz.ecommerce.pojo.CbecTax;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Created by fanshilei on 2016/3/28.
 * <p/>
 * 查询跟踪服务--税单查询
 */
@Controller
@RequestMapping("/searchManage/taxbill")
@Scope("prototype")
public class SearchTaxbillController {

    @Autowired
    private CbecTaxDao cbecTaxDao;

    /**
     * 税单管理初始页
     *
     * @return
     */
    @RequestMapping(value = "init", method = {RequestMethod.GET})
    public String init() {
        return "searchManage/taxbill/taxbill";
    }

    /**
     * 税单列表页查询List
     *
     * @param cbecTax
     * @param request
     * @return
     */
    @RequestMapping("/queryCbecTaxList")
    @ResponseBody
    public GridResult queryCbecTaxList(CbecTax cbecTax, GridRequest request) {
        return new GridResult(cbecTaxDao.page(TableConstants.CBEC_TAX, cbecTax, request.getStart(), request.getEnd(), request.getSortOrder()), request, cbecTaxDao.count(TableConstants.CBEC_TAX, cbecTax));
    }

}
